<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateVueAdminUserRoutersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('vue_admin_user_routers', function (Blueprint $table) {
            $table->char('id', 20)->primary()->comment('ID');
            $table->integer('user_id')->nullable()->comment('用户ID');
            $table->string('parent_id', 100)->comment('父级ID');
            $table->integer('model_id')->nullable();
            $table->boolean('is_custom')->nullable()->default(false)->comment('是否自定义');
            $table->string('title', 50)->comment('标题');
            $table->string('path', 50)->nullable()->comment('路径');
            $table->integer('order')->default(0)->comment('排序');
            $table->string('icon', 50)->nullable()->comment('图标');
            $table->boolean('menu')->default(false)->comment('菜单');
            $table->boolean('cache')->default(false)->comment('缓存');
            $table->dateTime('created_at')->nullable()->comment('创建时间');
            $table->dateTime('updated_at')->nullable()->comment('更新时间');
            $table->softDeletes()->comment('删除时间');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('vue_admin_user_routers');
    }
}
